package
{
	import flash.display.Loader;
	import flash.events.Event;
	import flash.net.URLRequest;

	public class rLoader extends Loader
	{
		//
		static public var loading:int = 0;
		public var file:String = "";
		private var doEvent:Function = null;
		//
		public function rLoader( file:String, listen:Function )
		{
			super();
			this.contentLoaderInfo.addEventListener(Event.COMPLETE,LoadCompleted);
			this.file=file;
			doEvent = listen;
			loading++;
			this.load( new URLRequest(file) );
		}
		public function LoadCompleted( e:Event ):void{
			doEvent( e );
			loading--;
		}
	}
}